package com.eshop.dao;

import java.sql.Connection;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;

public class Conn {

	public static Connection getConn()
	{
		try {
			Context context = new InitialContext();
			DataSource datasource = (DataSource)context.lookup("java:comp/env/jndi/jsp");
			Connection connection = datasource.getConnection();
			return connection;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
}
